package flyweight.tree;

import java.util.ArrayList;
import java.util.List;

public class Forest {
    List<Tree> trees = new ArrayList<>();

    public void plantTree(int x, int y, String name, String color, String texture)
    {
        TreeType type = TreeFactory.getTreeType(name, color, texture);
        Tree tree = new Tree(x, y, type);
        trees.add(tree);
    }

    public void draw(String canvas)
    {
        for (Tree tree : trees)
        {
            tree.draw(canvas);
            System.out.println(tree.treeType);
            System.out.println("--------------------------------------");
        }
    }
}